package com.rentplant.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.rentplant.Pojo.helpinfo;
import com.rentplant.Pojo.helpinfoanduser;
import com.rentplant.mapper.helpInfoMapper;
import com.rentplant.service.helpInfoService;
import com.sun.org.apache.regexp.internal.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.websocket.OnError;
import java.awt.*;
import java.util.List;

@Service //让他知道这是service
public class helpInfoServiceImp implements helpInfoService {

    @Autowired
    private helpInfoMapper helpinfomapper;

    //    提交求租信息
    @Override
    public  boolean addHelpInfo(JSONObject helpinfo){
        return helpinfomapper.addHelpInfo(helpinfo);
    }

    //    查询最热求租信息
    @Override
    public List<helpinfoanduser> helpInfoByHot(){
        return helpinfomapper.helpInfoByHot();
    }

    //查询最新信息
    @Override
    public  List<helpinfoanduser> helpInfoByTime(){
        return helpinfomapper.helpInfoByTime();
    }

    //按照id查找求租信息
    @Override
    public List<helpinfoanduser> helpInfoById(JSONObject helpinfo){
        return helpinfomapper.helpInfoById(helpinfo);
    }

    //求租信息浏览自增
    @Override
    public boolean addInfoSee(JSONObject helpinfo){
        return helpinfomapper.addInfoSee(helpinfo);
    }

    //查询用户发布的求租信息
    @Override
    public List<helpinfo>showHelpInfo(JSONObject helpinfo){
        return helpinfomapper.showHelpInfo(helpinfo);
    }

    //        查询全部求租信息并分页
    @Override
    public List<helpinfo> allHelpInfo(JSONObject pageinfo){return helpinfomapper.allHelpInfo(pageinfo);}
    @Override
    public List<helpinfo> allHelpInfos(){return helpinfomapper.allHelpInfos();}

    //    修改求租信息
    @Override
    public boolean updateHelpInfo(JSONObject helpinfo){return helpinfomapper.updateHelpInfo(helpinfo);}

    //    条件查找
    @Override
    public List<helpinfo> searchHelp(JSONObject searchinfo){
        return helpinfomapper.searchHelp(searchinfo);
    }

    //    条件查找
    @Override
    public List<helpinfo> searchHelps(JSONObject searchinfo){
        return helpinfomapper.searchHelps(searchinfo);
    }
}
